home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-05-25 | 7.9 KB | 279 lines | [TEXT/MPS ] |
- ;
- ; File: URLAccess.a
- ;
- ; Contains: URL Access Interfaces.
- ;
- ; Version: Technology: 1.0
- ; Release: Veronica Seed, Use with 3.2 Universal Interfaces
- ;
- ; Copyright: © 1994-1999 by Apple Computer, Inc., all rights reserved
- ;
- ; Bugs?: For bug reports, consult the following page on
- ; the World Wide Web:
- ;
- ; http://developer.apple.com/bugreporter/
- ;
- ;
- IF &TYPE('__URLACCESS__') = 'UNDEFINED' THEN
- __URLACCESS__ SET 1
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- IF &TYPE('__FILES__') = 'UNDEFINED' THEN
- include 'Files.a'
- ENDIF
- IF &TYPE('__CODEFRAGMENTS__') = 'UNDEFINED' THEN
- include 'CodeFragments.a'
- ENDIF
-
- ; Data structures and types
-
-
-
-
- kURLReplaceExistingFlag EQU $01
- kURLBinHexFileFlag EQU $02 ; Binhex before uploading if necessary
- kURLExpandFileFlag EQU $04 ; Use StuffIt engine to expand file if necessary
- kURLDisplayProgressFlag EQU $08
- kURLDisplayAuthFlag EQU $10 ; Display auth dialog if guest connection fails
- kURLUploadFlag EQU $20 ; Do an upload instead of a download
- kURLIsDirectoryHintFlag EQU $40 ; Hint: the URL is a directory
- kURLDoNotTryAnonymousFlag EQU $80 ; Don't try to connect anonymously before getting logon info
- kURLDirectoryListingFlag EQU $0100 ; Download the directory listing, not the whole directory
- kURLReservedFlag EQU $80000000 ; reserved for Apple internal use
- ; typedef UInt32 URLOpenFlags
-
-
- kURLNullState EQU 0
- kURLInitiatingState EQU 1
- kURLLookingUpHostState EQU 2 ; NOT IN EXT HEADER
- kURLConnectingState EQU 3 ; NOT IN EXT HEADER
- kURLResourceFoundState EQU 4
- kURLDownloadingState EQU 5
- kURLDataAvailableState EQU $15
- kURLTransactionCompleteState EQU 6
- kURLErrorOccurredState EQU 7
- kURLAbortingState EQU 8
- kURLCompletedState EQU 9
- kURLUploadingState EQU 10
- ; typedef UInt32 URLState
-
-
- kURLInitiatedEvent EQU 1
- kURLResourceFoundEvent EQU 4
- kURLDownloadingEvent EQU 5
- kURLAbortInitiatedEvent EQU 8
- kURLCompletedEvent EQU 9
- kURLErrorOccurredEvent EQU 7
- kURLDataAvailableEvent EQU $15
- kURLTransactionCompleteEvent EQU 6
- kURLUploadingEvent EQU 10
- kURLSystemEvent EQU 29
- kURLPercentEvent EQU 30
- kURLPeriodicEvent EQU 31
- kURLPropertyChangedEvent EQU 32
- ; typedef UInt32 URLEvent
-
-
- kURLInitiatedEventMask EQU $01
- kURLResourceFoundEventMask EQU $08
- kURLDownloadingMask EQU $10
- kURLUploadingMask EQU $0200
- kURLAbortInitiatedMask EQU $80
- kURLCompletedEventMask EQU $0100
- kURLErrorOccurredEventMask EQU $40
- kURLDataAvailableEventMask EQU $00100000
- kURLTransactionCompleteEventMask EQU $20
- kURLSystemEventMask EQU $10000000
- kURLPercentEventMask EQU $20000000
- kURLPeriodicEventMask EQU $40000000
- kURLPropertyChangedEventMask EQU $80000000
- kURLAllBufferEventsMask EQU $00100020
- kURLAllNonBufferEventsMask EQU $E00003D1
- kURLAllEventsMask EQU $FFFFFFFF
- ; typedef UInt32 URLEventMask
-
- URLCallbackInfo RECORD 0
- version ds.l 1 ; offset: $0 (0)
- urlRef ds.l 1 ; offset: $4 (4)
- property ds.l 1 ; offset: $8 (8)
- currentSize ds.l 1 ; offset: $C (12)
- systemEvent ds.l 1 ; offset: $10 (16)
- sizeof EQU * ; size: $14 (20)
- ENDR
- ; http and https properties
- ; authentication type flags
-
- kUserNameAndPasswordFlag EQU $00000001
- ;
- ; pascal OSStatus URLGetURLAccessVersion(UInt32 *returnVers)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLGetURLAccessVersion
- ENDIF
-
- IF TARGET_RT_MAC_CFM THEN
- ;
- ; URLAccessAvailable() is a macro/inline available only in C/C++.
- ; To get the same functionality from pascal or assembly, you need
- ; to test if URLGetURLAccessVersion function is not NULL. For instance:
- ;
- ; gURLAccessAvailable = FALSE;
- ; IF @URLAccessAvailable <> kUnresolvedCFragSymbolAddress THEN
- ; gURLAccessAvailable = TRUE;
- ; END
- ;
- ;
-
- ENDIF ; TARGET_RT_MAC_CFM
- ;
- ; pascal OSStatus URLSimpleDownload(const char *url, FSSpec *destination, Handle destinationHandle, URLOpenFlags openFlags, URLSystemEventProcPtr eventProc, void *userContext)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLSimpleDownload
- ENDIF
-
- ;
- ; pascal OSStatus URLDownload(URLReference urlRef, FSSpec *destination, Handle destinationHandle, URLOpenFlags openFlags, URLSystemEventProcPtr eventProc, void *userContext)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLDownload
- ENDIF
-
- ;
- ; pascal OSStatus URLSimpleUpload(const char *url, const FSSpec *source, URLOpenFlags openFlags, URLSystemEventProcPtr eventProc, void *userContext)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLSimpleUpload
- ENDIF
-
- ;
- ; pascal OSStatus URLUpload(URLReference urlRef, const FSSpec *source, URLOpenFlags openFlags, URLSystemEventProcPtr eventProc, void *userContext)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLUpload
- ENDIF
-
- ;
- ; pascal OSStatus URLNewReference(const char *url, URLReference *urlRef)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLNewReference
- ENDIF
-
- ;
- ; pascal OSStatus URLDisposeReference(URLReference urlRef)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLDisposeReference
- ENDIF
-
- ;
- ; pascal OSStatus URLOpen(URLReference urlRef, FSSpec *fileSpec, URLOpenFlags openFlags, URLNotifyProcPtr notifyProc, URLEventMask eventRegister, void *userContext)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLOpen
- ENDIF
-
- ;
- ; pascal OSStatus URLAbort(URLReference urlRef)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLAbort
- ENDIF
-
- ;
- ; pascal OSStatus URLGetDataAvailable(URLReference urlRef, Size *dataSize)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLGetDataAvailable
- ENDIF
-
- ;
- ; pascal OSStatus URLGetBuffer(URLReference urlRef, void **buffer, Size *bufferSize)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLGetBuffer
- ENDIF
-
- ;
- ; pascal OSStatus URLReleaseBuffer(URLReference urlRef, void *buffer)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLReleaseBuffer
- ENDIF
-
- ;
- ; pascal OSStatus URLGetProperty(URLReference urlRef, const char *property, void *propertyBuffer, Size bufferSize)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLGetProperty
- ENDIF
-
- ;
- ; pascal OSStatus URLGetPropertySize(URLReference urlRef, const char *property, Size *propertySize)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLGetPropertySize
- ENDIF
-
- ;
- ; pascal OSStatus URLSetProperty(URLReference urlRef, const char *property, void *propertyBuffer, Size bufferSize)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLSetProperty
- ENDIF
-
- ;
- ; pascal OSStatus URLGetCurrentState(URLReference urlRef, URLState *state)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLGetCurrentState
- ENDIF
-
- ;
- ; pascal OSStatus URLGetError(URLReference urlRef, OSStatus *urlError)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLGetError
- ENDIF
-
-
- ;
- ; pascal OSStatus URLIdle(void)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLIdle
- ENDIF
-
- ;
- ; pascal OSStatus URLGetFileInfo(StringPtr fName, OSType *fType, OSType *fCreator)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION URLGetFileInfo
- ENDIF
-
-
- ; Error Codes
-
- kURLInternetAccessErrorCodeBase EQU -30770
- kURLInvalidURLReferenceError EQU -30770
- kURLProgressAlreadyDisplayedError EQU -30771
- kURLDestinationExistsError EQU -30772
- kURLInvalidURLError EQU -30773
- kURLUnsupportedSchemeError EQU -30774
- kURLServerBusyError EQU -30775
- kURLAuthenticationError EQU -30776
- kURLPropertyNotYetKnownError EQU -30777
- kURLUnknownPropertyError EQU -30778
- kURLPropertyBufferTooSmallError EQU -30779
- kURLUnsettablePropertyError EQU -30780
- kURLInvalidCallError EQU -30781
- kURLFileEmptyError EQU -30783
- kURLExtensionFailureError EQU -30785
- kURLInvalidConfigurationError EQU -30786
- kURLAccessNotAvailableError EQU -30787
- ENDIF ; __URLACCESS__
-
-